<?php
require_once("../db/db_connector.php");
require_once("../db/db_user.php");

// Database Access Begins ---------------------------------------- //
$con = get_db_con();
$user_list = get_user_list($con);
close_db_con();
// Database Access Ends ------------------------------------------ //

?>

<?php
include_once("../include/admin_header.php");
?>

<h2>User</h2>
<a href="user_edit.php">Create User</a>
<table>
	<tr>
		<th>id</th>
		<th>username</th>
		<th>password</th>
		<th>email</th>
		<th>is_admin</th>
	</tr>
<?php foreach ($user_list as $user): ?>
	<tr>
		<td><?=$user["id"]?></td>
		<td><?=$user["username"]?></td>
		<td><?=$user["password"]?></td>
		<td><?=$user["email"]?></td>
		<td><?=$user["is_admin"]?></td>
	</tr>
<?php endforeach ?>
</table>

<?php
include_once("../include/admin_footer.php");
?>
